<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/exception/info.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/exception</a> - info.hpp<span style="font-size: 80%;"> (source / <a href="info.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">39</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">25</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : //Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : //Distributed under the Boost Software License, Version 1.0. (See accompanying
<span class="lineNum">       4 </span>            : //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       5 </span>            : 
<span class="lineNum">       6 </span>            : #ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
<span class="lineNum">       7 </span>            : #define UUID_8D22C4CA9CC811DCAA9133D256D89593
<span class="lineNum">       8 </span>            : #if (__GNUC__*100+__GNUC_MINOR__&gt;301) &amp;&amp; !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
<span class="lineNum">       9 </span>            : #pragma GCC system_header
<span class="lineNum">      10 </span>            : #endif
<span class="lineNum">      11 </span>            : #if defined(_MSC_VER) &amp;&amp; !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
<span class="lineNum">      12 </span>            : #pragma warning(push,1)
<span class="lineNum">      13 </span>            : #endif
<span class="lineNum">      14 </span>            : 
<span class="lineNum">      15 </span>            : #include &lt;boost/exception/exception.hpp&gt;
<span class="lineNum">      16 </span>            : #include &lt;boost/exception/to_string_stub.hpp&gt;
<span class="lineNum">      17 </span>            : #include &lt;boost/exception/detail/error_info_impl.hpp&gt;
<span class="lineNum">      18 </span>            : #include &lt;boost/shared_ptr.hpp&gt;
<span class="lineNum">      19 </span>            : #include &lt;boost/config.hpp&gt;
<span class="lineNum">      20 </span>            : #include &lt;map&gt;
<span class="lineNum">      21 </span>            : 
<span class="lineNum">      22 </span>            : namespace
<span class="lineNum">      23 </span>            : boost
<span class="lineNum">      24 </span>            :     {
<span class="lineNum">      25 </span>            :     template &lt;class Tag,class T&gt;
<span class="lineNum">      26 </span>            :     inline
<span class="lineNum">      27 </span>            :     std::string
<span class="lineNum">      28 </span>            :     error_info_name( error_info&lt;Tag,T&gt; const &amp; x )
<span class="lineNum">      29 </span>            :         {
<span class="lineNum">      30 </span>            :         return tag_type_name&lt;Tag&gt;();
<span class="lineNum">      31 </span>            :         }
<span class="lineNum">      32 </span>            : 
<span class="lineNum">      33 </span>            :     template &lt;class Tag,class T&gt;
<span class="lineNum">      34 </span>            :     inline
<span class="lineNum">      35 </span>            :     std::string
<span class="lineNum">      36 </span>            :     to_string( error_info&lt;Tag,T&gt; const &amp; x )
<span class="lineNum">      37 </span>            :         {
<span class="lineNum">      38 </span>            :         return '[' + error_info_name(x) + &quot;] = &quot; + to_string_stub(x.value()) + '\n';
<span class="lineNum">      39 </span>            :         }
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span>            :     template &lt;class Tag,class T&gt;
<span class="lineNum">      42 </span>            :     inline
<span class="lineNum">      43 </span>            :     error_info&lt;Tag,T&gt;::
<span class="lineNum">      44 </span>            :     error_info( value_type const &amp; value ):
<span class="lineNum">      45 </span><span class="lineNoCov">          0 :         value_(value)</span>
<span class="lineNum">      46 </span>            :         {
<span class="lineNum">      47 </span>            :         }
<span class="lineNum">      48 </span>            : 
<a name="49"><span class="lineNum">      49 </span>            :     template &lt;class Tag,class T&gt;</a>
<span class="lineNum">      50 </span>            :     inline
<span class="lineNum">      51 </span><span class="lineNoCov">          0 :     error_info&lt;Tag,T&gt;::</span>
<span class="lineNum">      52 </span>            :     ~error_info() throw()
<span class="lineNum">      53 </span>            :         {
<span class="lineNum">      54 </span><span class="lineNoCov">          0 :         }</span>
<span class="lineNum">      55 </span>            : 
<span class="lineNum">      56 </span>            :     template &lt;class Tag,class T&gt;
<a name="57"><span class="lineNum">      57 </span>            :     inline</a>
<span class="lineNum">      58 </span>            :     std::string
<span class="lineNum">      59 </span><span class="lineNoCov">          0 :     error_info&lt;Tag,T&gt;::</span>
<span class="lineNum">      60 </span>            :     name_value_string() const
<span class="lineNum">      61 </span>            :         {
<span class="lineNum">      62 </span><span class="lineNoCov">          0 :         return to_string_stub(*this);</span>
<span class="lineNum">      63 </span>            :         }
<span class="lineNum">      64 </span>            : 
<span class="lineNum">      65 </span>            :     namespace
<span class="lineNum">      66 </span>            :     exception_detail
<span class="lineNum">      67 </span>            :         {
<span class="lineNum">      68 </span>            :         class
<span class="lineNum">      69 </span>            :         error_info_container_impl:
<span class="lineNum">      70 </span>            :             public error_info_container
<span class="lineNum">      71 </span>            :             {
<span class="lineNum">      72 </span>            :             public:
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span>            :             error_info_container_impl():
<span class="lineNum">      75 </span><span class="lineNoCov">          0 :                 count_(0)</span>
<span class="lineNum">      76 </span>            :                 {
<span class="lineNum">      77 </span>            :                 }
<span class="lineNum">      78 </span>            : 
<span class="lineNum">      79 </span><span class="lineNoCov">          0 :             ~error_info_container_impl() throw()</span>
<span class="lineNum">      80 </span><span class="lineNoCov">          0 :                 {</span>
<span class="lineNum">      81 </span><span class="lineNoCov">          0 :                 }</span>
<a name="82"><span class="lineNum">      82 </span>            : </a>
<span class="lineNum">      83 </span>            :             void
<span class="lineNum">      84 </span><span class="lineNoCov">          0 :             set( shared_ptr&lt;error_info_base&gt; const &amp; x, type_info_ const &amp; typeid_ )</span>
<span class="lineNum">      85 </span>            :                 {
<span class="lineNum">      86 </span>            :                 BOOST_ASSERT(x);
<span class="lineNum">      87 </span><span class="lineNoCov">          0 :                 info_[typeid_] = x;</span>
<span class="lineNum">      88 </span>            :                 diagnostic_info_str_.clear();
<span class="lineNum">      89 </span><span class="lineNoCov">          0 :                 }</span>
<a name="90"><span class="lineNum">      90 </span>            : </a>
<span class="lineNum">      91 </span>            :             shared_ptr&lt;error_info_base&gt;
<span class="lineNum">      92 </span><span class="lineNoCov">          0 :             get( type_info_ const &amp; ti ) const</span>
<span class="lineNum">      93 </span>            :                 {
<span class="lineNum">      94 </span>            :                 error_info_map::const_iterator i=info_.find(ti);
<span class="lineNum">      95 </span><span class="lineNoCov">          0 :                 if( info_.end()!=i )</span>
<span class="lineNum">      96 </span>            :                     {
<span class="lineNum">      97 </span>            :                     shared_ptr&lt;error_info_base&gt; const &amp; p = i-&gt;second;
<span class="lineNum">      98 </span>            : #ifndef BOOST_NO_RTTI
<span class="lineNum">      99 </span>            :                     BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
<span class="lineNum">     100 </span>            : #endif
<span class="lineNum">     101 </span>            :                     return p;
<span class="lineNum">     102 </span>            :                     }
<span class="lineNum">     103 </span>            :                 return shared_ptr&lt;error_info_base&gt;();
<span class="lineNum">     104 </span>            :                 }
<a name="105"><span class="lineNum">     105 </span>            : </a>
<span class="lineNum">     106 </span>            :             char const *
<span class="lineNum">     107 </span><span class="lineNoCov">          0 :             diagnostic_information( char const * header ) const</span>
<span class="lineNum">     108 </span>            :                 {
<span class="lineNum">     109 </span><span class="lineNoCov">          0 :                 if( header )</span>
<span class="lineNum">     110 </span>            :                     {
<span class="lineNum">     111 </span><span class="lineNoCov">          0 :                     std::ostringstream tmp;</span>
<span class="lineNum">     112 </span><span class="lineNoCov">          0 :                     tmp &lt;&lt; header;</span>
<span class="lineNum">     113 </span><span class="lineNoCov">          0 :                     for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )</span>
<span class="lineNum">     114 </span>            :                         {
<span class="lineNum">     115 </span>            :                         error_info_base const &amp; x = *i-&gt;second;
<span class="lineNum">     116 </span><span class="lineNoCov">          0 :                         tmp &lt;&lt; x.name_value_string();</span>
<span class="lineNum">     117 </span>            :                         }
<span class="lineNum">     118 </span><span class="lineNoCov">          0 :                     tmp.str().swap(diagnostic_info_str_);</span>
<span class="lineNum">     119 </span>            :                     }
<span class="lineNum">     120 </span><span class="lineNoCov">          0 :                 return diagnostic_info_str_.c_str();</span>
<span class="lineNum">     121 </span>            :                 }
<span class="lineNum">     122 </span>            : 
<span class="lineNum">     123 </span>            :             private:
<span class="lineNum">     124 </span>            : 
<span class="lineNum">     125 </span>            :             friend class boost::exception;
<span class="lineNum">     126 </span>            : 
<span class="lineNum">     127 </span>            :             typedef std::map&lt; type_info_, shared_ptr&lt;error_info_base&gt; &gt; error_info_map;
<span class="lineNum">     128 </span>            :             error_info_map info_;
<span class="lineNum">     129 </span>            :             mutable std::string diagnostic_info_str_;
<span class="lineNum">     130 </span>            :             mutable int count_;
<span class="lineNum">     131 </span>            : 
<span class="lineNum">     132 </span>            :             error_info_container_impl( error_info_container_impl const &amp; );
<span class="lineNum">     133 </span>            :             error_info_container_impl &amp; operator=( error_info_container const &amp; );
<a name="134"><span class="lineNum">     134 </span>            : </a>
<span class="lineNum">     135 </span>            :             void
<span class="lineNum">     136 </span><span class="lineNoCov">          0 :             add_ref() const</span>
<span class="lineNum">     137 </span>            :                 {
<span class="lineNum">     138 </span><span class="lineNoCov">          0 :                 ++count_;</span>
<span class="lineNum">     139 </span><span class="lineNoCov">          0 :                 }</span>
<a name="140"><span class="lineNum">     140 </span>            : </a>
<span class="lineNum">     141 </span>            :             bool
<span class="lineNum">     142 </span><span class="lineNoCov">          0 :             release() const</span>
<span class="lineNum">     143 </span>            :                 {
<span class="lineNum">     144 </span><span class="lineNoCov">          0 :                 if( --count_ )</span>
<span class="lineNum">     145 </span>            :                     return false;
<span class="lineNum">     146 </span>            :                 else
<span class="lineNum">     147 </span>            :                     {
<span class="lineNum">     148 </span><span class="lineNoCov">          0 :                     delete this;</span>
<span class="lineNum">     149 </span>            :                     return true;
<span class="lineNum">     150 </span>            :                     }
<span class="lineNum">     151 </span>            :                 }
<span class="lineNum">     152 </span>            : 
<span class="lineNum">     153 </span>            :             refcount_ptr&lt;error_info_container&gt;
<span class="lineNum">     154 </span><span class="lineNoCov">          0 :             clone() const</span>
<span class="lineNum">     155 </span>            :                 {
<span class="lineNum">     156 </span>            :                 refcount_ptr&lt;error_info_container&gt; p;
<span class="lineNum">     157 </span><span class="lineNoCov">          0 :                 error_info_container_impl * c=new error_info_container_impl;</span>
<span class="lineNum">     158 </span><span class="lineNoCov">          0 :                 p.adopt(c);</span>
<span class="lineNum">     159 </span>            :                 c-&gt;info_ = info_;
<span class="lineNum">     160 </span><span class="lineNoCov">          0 :                 return p;</span>
<span class="lineNum">     161 </span>            :                 }
<span class="lineNum">     162 </span>            :             };
<span class="lineNum">     163 </span>            : 
<span class="lineNum">     164 </span>            :         template &lt;class E,class Tag,class T&gt;
<span class="lineNum">     165 </span>            :         inline
<span class="lineNum">     166 </span>            :         E const &amp;
<span class="lineNum">     167 </span><span class="lineNoCov">          0 :         set_info( E const &amp; x, error_info&lt;Tag,T&gt; const &amp; v )</span>
<span class="lineNum">     168 </span>            :             {
<span class="lineNum">     169 </span>            :             typedef error_info&lt;Tag,T&gt; error_info_tag_t;
<span class="lineNum">     170 </span><span class="lineNoCov">          0 :             shared_ptr&lt;error_info_tag_t&gt; p( new error_info_tag_t(v) );</span>
<span class="lineNum">     171 </span>            :             exception_detail::error_info_container * c=x.data_.get();
<span class="lineNum">     172 </span><span class="lineNoCov">          0 :             if( !c )</span>
<span class="lineNum">     173 </span><span class="lineNoCov">          0 :                 x.data_.adopt(c=new exception_detail::error_info_container_impl);</span>
<span class="lineNum">     174 </span><span class="lineNoCov">          0 :             c-&gt;set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));</span>
<span class="lineNum">     175 </span><span class="lineNoCov">          0 :             return x;</span>
<span class="lineNum">     176 </span>            :             }
<span class="lineNum">     177 </span>            : 
<span class="lineNum">     178 </span>            :         template &lt;class T&gt;
<span class="lineNum">     179 </span>            :         struct
<span class="lineNum">     180 </span>            :         derives_boost_exception
<span class="lineNum">     181 </span>            :             {
<span class="lineNum">     182 </span>            :             enum e { value = (sizeof(dispatch_boost_exception((T*)0))==sizeof(large_size)) };
<span class="lineNum">     183 </span>            :             };
<span class="lineNum">     184 </span>            :         }
<span class="lineNum">     185 </span>            : 
<span class="lineNum">     186 </span>            :     template &lt;class E,class Tag,class T&gt;
<span class="lineNum">     187 </span>            :     inline
<span class="lineNum">     188 </span>            :     typename enable_if&lt;exception_detail::derives_boost_exception&lt;E&gt;,E const &amp;&gt;::type
<span class="lineNum">     189 </span>            :     operator&lt;&lt;( E const &amp; x, error_info&lt;Tag,T&gt; const &amp; v )
<span class="lineNum">     190 </span>            :         {
<span class="lineNum">     191 </span><span class="lineNoCov">          0 :         return exception_detail::set_info(x,v);</span>
<span class="lineNum">     192 </span>            :         }
<span class="lineNum">     193 </span>            :     }
<span class="lineNum">     194 </span>            : 
<span class="lineNum">     195 </span>            : #if defined(_MSC_VER) &amp;&amp; !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
<span class="lineNum">     196 </span>            : #pragma warning(pop)
<span class="lineNum">     197 </span>            : #endif
<span class="lineNum">     198 </span>            : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
